package com.fesine.ch01.lesson04.sameNum.extthread;

/**
 * 留意i-- 与System.out.println的异常
 * Created by Fesine on 2016/6/26.
 */
public class MyThread extends Thread {
    private int i =5;

    //@Override
    //public void run() {
    //    System.out.println("i=" + (i--) +" threadName =" + Thread.currentThread().getName());
    //}
    @Override
    synchronized public void run() {
        System.out.println("i=" + (i--) +" threadName =" + Thread.currentThread().getName());
    }
}
